package com.atguigu.lease.common.uilt;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jakarta.servlet.http.HttpServletRequest;
import org.jetbrains.annotations.NotNull;

/**
 * 分页工具类
 *
 * @ClassName PageUtil
 * @Author admin
 * @Date 2024/6/
 */
public class PageUtil {
    public static <T> @NotNull Page<T> getPage(HttpServletRequest request) {
        String current = request.getParameter("current");
        String size = request.getParameter("size");
        return Page.of(Long.parseLong(current), Long.parseLong(size));
    }
}
